home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1035 / 1035.xpi / chrome / 1clickweather.jar / content / 1clickweather / js / config / appconfig.js next >
Encoding:
JavaScript  |  2008-10-05  |  31.9 KB  |  1,077 lines

  1. // ⌐ 2005 The Weather Channel Interactive, Inc.  All Rights Reserved.
  2.  
  3. /*
  4.     AppConfig - Manager object for
  5.     application configuration
  6. */
  7. function AppConfig() {
  8.     this.fileManager = new FileManager();
  9.     this.info = new AppConfigInfo();
  10.     this.allWindows = {};
  11.     this.allData = {};
  12.     this.allMaps = {};
  13.     this.allVideos = {};
  14.     this.allIcons = {};
  15.     this.allLinks = {};    
  16. }
  17.  
  18. AppConfig.prototype = {
  19.     fileManager : null,
  20.     info : null,
  21.     addData : null,
  22.     allWindows : null,
  23.     allMaps : null,
  24.     allVideos : null,
  25.     allIcons : null,
  26.     allLinks : null,
  27.  
  28.     // THIS METHOD LOADS DATA
  29.     // FROM CONFIG XML
  30.     load : function() {
  31.         try {
  32.             var myDOM = this.fileManager.getAppConfigDOM();
  33.             // now parse the dom to populate this object!
  34.             var rootElement = myDOM.getElementsByTagName("appconfig")[0];
  35.             // get the info element
  36.             var infoElement = rootElement.getElementsByTagName("info")[0];
  37.             this.info.setVersion(infoElement.getElementsByTagName("version")[0].firstChild.nodeValue);
  38.             this.info.setLastUpdate(infoElement.getElementsByTagName("lastupdate")[0].firstChild.nodeValue );
  39.             this.info.setIsInitial(infoElement.getElementsByTagName("initial")[0].firstChild.nodeValue );
  40.         
  41.             var windowsElements = rootElement.getElementsByTagName("windows")[0].getElementsByTagName("window");
  42.             var a = 0;
  43.             for(a = 0;a < windowsElements.length;a++) {
  44.                 var nextWinElement = windowsElements[a];
  45.                 var appWinObj = new AppWindow();
  46.                 appWinObj.setName(nextWinElement.getAttribute("name"));
  47.                 appWinObj.setTitle(nextWinElement.getElementsByTagName("title")[0].firstChild.nodeValue);
  48.                 appWinObj.setWidth(nextWinElement.getElementsByTagName("width")[0].firstChild.nodeValue);
  49.                 appWinObj.setHeight(nextWinElement.getElementsByTagName("height")[0].firstChild.nodeValue);
  50.                 this.addWindow(appWinObj);
  51.             }
  52.  
  53.             var dataElements = rootElement.getElementsByTagName("data")[0].getElementsByTagName("dataelement");
  54.             var b = 0;
  55.             for(b=0;b<dataElements.length;b++) {
  56.                 var nextDataElement = dataElements[b];
  57.                 var newAppDataObj = new AppData();
  58.                 newAppDataObj.setName(nextDataElement.getAttribute("name"));
  59. try{
  60.                 var upinterval = new AppDataUpdateInterval();
  61.                 upinterval.setTime(nextDataElement.getElementsByTagName("updateinterval")[0].getAttribute("time"));
  62.                 upinterval.setMeasure(nextDataElement.getElementsByTagName("updateinterval")[0].getAttribute("measure"));
  63.                 newAppDataObj.setUpdateInterval(upinterval);
  64. }catch(e){}
  65.                 var dataurl = new AppDataURL();
  66.                 dataurl.setBase(nextDataElement.getElementsByTagName("dataurl")[0].getAttribute("base"));
  67.                 var allparams = nextDataElement.getElementsByTagName("dataurl")[0].getElementsByTagName("params")[0].getElementsByTagName("param");
  68.                 var bb = 0;
  69.                 for(bb = 0;bb<allparams.length;bb++) {
  70.                     var newParamObj = new AppDataURLParam();
  71.                     newParamObj.setName(allparams[bb].getAttribute("name"));
  72.                     dataurl.addNewParam(newParamObj);
  73.                 }
  74. try{
  75.                 newAppDataObj.setDataURL(dataurl);
  76.                 var wxiconsObj  = new AppDataWxIcons();
  77.                 wxiconsObj.setBase(nextDataElement.getElementsByTagName("wxicons")[0].getAttribute("base"));
  78.                 wxiconsObj.setSmall(nextDataElement.getElementsByTagName("wxicons")[0].getAttribute("small"));
  79.                 wxiconsObj.setLarge(nextDataElement.getElementsByTagName("wxicons")[0].getAttribute("large"));
  80.                 newAppDataObj.setWxIcons(wxiconsObj);
  81.                 var mooniconObj = new AppDataMoonphaseIcons();
  82.                 mooniconObj.setBase(nextDataElement.getElementsByTagName("moonphaseicons")[0].getAttribute("base"));
  83.                 newAppDataObj.setMoonPhaseIcons(mooniconObj);
  84. }catch(e){}
  85.                 this.addData(newAppDataObj);
  86.             }
  87.  
  88.             var mapsElements = rootElement.getElementsByTagName("maps")[0].getElementsByTagName("map");
  89.             var c = 0;
  90.             for(c = 0;c<mapsElements.length;c++) {
  91.                 var nextMapElement = mapsElements[c];
  92.                 var mapObj = new AppMap();
  93.                 mapObj.setID(nextMapElement.getAttribute("id"));
  94.                 mapObj.setIsUSOnly(nextMapElement.getElementsByTagName("isusonly")[0].firstChild.nodeValue);
  95.                 mapObj.setTitle(nextMapElement.getElementsByTagName("title")[0].firstChild.nodeValue);
  96.                 mapObj.setImage(nextMapElement.getElementsByTagName("image")[0].firstChild.nodeValue);
  97.                 mapObj.setImageAlt(nextMapElement.getElementsByTagName("imagealt")[0].firstChild.nodeValue);
  98.                 mapObj.setImageWidth(nextMapElement.getElementsByTagName("imagewidth")[0].firstChild.nodeValue);
  99.                 mapObj.setImageHeight(nextMapElement.getElementsByTagName("imageheight")[0].firstChild.nodeValue);
  100.                 mapObj.setURL(nextMapElement.getElementsByTagName("url")[0].firstChild.nodeValue);
  101.                 this.addMap(mapObj);
  102.             }
  103.  
  104.             var videoElements = rootElement.getElementsByTagName("videos")[0].getElementsByTagName("video");
  105.             var d = 0;
  106.             for(d=0;d<videoElements.length;d++) {
  107.                 var nextVideoElement = videoElements[d];
  108.                 var videoObj = new AppVideo();
  109.                 videoObj.setID(nextVideoElement.getAttribute("id"));
  110.                 videoObj.setCollection(nextVideoElement.getAttribute("collection"));
  111.                 videoObj.setName(nextVideoElement.getElementsByTagName("name")[0].firstChild.nodeValue);
  112.                 videoObj.setImage(nextVideoElement.getElementsByTagName("image")[0].firstChild.nodeValue);
  113.                 videoObj.setImageAlt(nextVideoElement.getElementsByTagName("imagealt")[0].firstChild.nodeValue);
  114.                 videoObj.setImageWidth(nextVideoElement.getElementsByTagName("imagewidth")[0].firstChild.nodeValue);
  115.                 videoObj.setImageHeight(nextVideoElement.getElementsByTagName("imageheight")[0].firstChild.nodeValue);
  116.                 videoObj.setTitle(nextVideoElement.getElementsByTagName("title")[0].firstChild.nodeValue);
  117.                 videoObj.setURL(nextVideoElement.getElementsByTagName("url")[0].firstChild.nodeValue);
  118.                 this.addVideo(videoObj);
  119.             }
  120.  
  121.             var iconsElements = rootElement.getElementsByTagName("icons")[0].getElementsByTagName("icon");
  122.             var e = 0;
  123.             for(e=0;e<iconsElements.length;e++) {
  124.                 var nextIconElement = iconsElements[e];
  125.                 var iconObj = new AppIcon();
  126.                 iconObj.setID(nextIconElement.getAttribute("id"));
  127.                 iconObj.setURL(nextIconElement.getElementsByTagName("url")[0].firstChild.nodeValue);
  128.                 iconObj.setName(nextIconElement.getElementsByTagName("name")[0].firstChild.nodeValue);
  129.                 iconObj.setAlt(nextIconElement.getElementsByTagName("alt")[0].firstChild.nodeValue);
  130.                 iconObj.setWidth(nextIconElement.getElementsByTagName("width")[0].firstChild.nodeValue);
  131.                 iconObj.setHeight(nextIconElement.getElementsByTagName("height")[0].firstChild.nodeValue);
  132.                 iconObj.setExt(nextIconElement.getElementsByTagName("ext")[0].firstChild.nodeValue);
  133.                 this.addIcon(iconObj);
  134.             }
  135.  
  136.             var linksElements = rootElement.getElementsByTagName("links")[0].getElementsByTagName("link");
  137.             var f = 0;
  138.             for(f=0;f<linksElements.length;f++) {
  139.                 var nextLinkElement = linksElements[f];
  140.                 var linkObj = new AppLink();
  141.                 linkObj.setID(nextLinkElement.getAttribute("id"));
  142.                 linkObj.setText(nextLinkElement.getElementsByTagName("text")[0].firstChild.nodeValue);
  143.                 linkObj.setURL(nextLinkElement.getElementsByTagName("url")[0].firstChild.nodeValue);
  144.                 linkObj.setAlt(nextLinkElement.getElementsByTagName("alt")[0].firstChild.nodeValue);
  145.                 linkObj.setIcon(nextLinkElement.getElementsByTagName("icon")[0].firstChild.nodeValue);
  146.                 this.addLink(linkObj);
  147.             }
  148.         } catch(e) {
  149.             alert(e);
  150.         }
  151.     },
  152.  
  153.     // THIS METHOD WRITES DATA
  154.     // TO CONFIG XML
  155.     save : function() {
  156.         try {
  157.             this.fileManager.saveAppConfigToFile(this.toDOM());
  158.         } catch(e) {
  159.             alert(e);
  160.         }
  161.     },
  162.  
  163.     // THIS METHOD TRANSFORMS THIS OBJECT
  164.     // TO XML DOM
  165.     toDOM : function() {
  166.         var xmlDoc = document.implementation.createDocument("", "", null);
  167.         var rootElement = xmlDoc.createElement("appconfig");
  168.         var info = xmlDoc.createElement("info");
  169.         var infoVersion = xmlDoc.createElement("version");
  170.         infoVersion.appendChild(xmlDoc.createTextNode(this.getInfo().getVersion()));
  171.         var infoLastUpdate = xmlDoc.createElement("lastupdate");
  172.         infoLastUpdate.appendChild(xmlDoc.createTextNode(this.getInfo().getLastUpdate()));
  173.         var infoInitial = xmlDoc.createElement("initial");
  174.         infoInitial.appendChild(xmlDoc.createTextNode(this.getInfo().getIsInitial()));
  175.  
  176.         info.appendChild(infoVersion);
  177.         info.appendChild(infoLastUpdate);
  178.         info.appendChild(infoInitial);
  179.  
  180.         rootElement.appendChild(info);
  181.  
  182.         var allWindows = xmlDoc.createElement("windows");
  183.         for(var nextWinKey in this.allWindows) {
  184.             var nextWinObj = this.allWindows[nextWinKey];
  185.             var winElement = xmlDoc.createElement("window");
  186.             winElement.setAttribute("name", nextWinObj.getName());
  187.             var winElementTitle = xmlDoc.createElement("title");
  188.             winElementTitle.appendChild(xmlDoc.createTextNode(nextWinObj.getTitle()));
  189.             winElement.appendChild(winElementTitle);
  190.  
  191.             var winElementWidth = xmlDoc.createElement("width");
  192.             winElementWidth.appendChild(xmlDoc.createTextNode(nextWinObj.getWidth()));
  193.             winElement.appendChild(winElementWidth);
  194.  
  195.             var winElementHeight = xmlDoc.createElement("height");
  196.             winElementHeight.appendChild(xmlDoc.createTextNode(nextWinObj.getHeight()));
  197.             winElement.appendChild(winElementHeight);
  198.  
  199.  
  200.             allWindows.appendChild(winElement);
  201.         }
  202.         rootElement.appendChild(allWindows);
  203.  
  204.  
  205.         var allData = xmlDoc.createElement("data");
  206.          for(var nextDataKey in this.allData) {
  207.             var nextDataObj = this.allData[nextDataKey];
  208.             var dataElement = xmlDoc.createElement("dataelement");
  209.             dataElement.setAttribute("name", nextDataObj.getName());
  210.  
  211.             var dataUpdateElement = xmlDoc.createElement("updateinterval");
  212.             dataUpdateElement.setAttribute("time",nextDataObj.getUpdateInterval().getTime());
  213.             dataUpdateElement.setAttribute("measure",nextDataObj.getUpdateInterval().getMeasure());
  214.             dataElement.appendChild(dataUpdateElement);
  215.  
  216.             var dataURLElement = xmlDoc.createElement("dataurl");
  217.             dataURLElement.setAttribute("base", nextDataObj.getDataURL().getBase());
  218.             var dataURLParams = xmlDoc.createElement("params");
  219.             var allParams = nextDataObj.getDataURL().getParams();
  220.             for(var nextParamKey in allParams) {
  221.                 var nextParam = allParams[nextParamKey];
  222.                 var nextParamElement = xmlDoc.createElement("param");
  223.                 nextParamElement.setAttribute("name", nextParam.getName());
  224.                 dataURLParams.appendChild(nextParamElement);
  225.             }
  226.  
  227.             dataURLElement.appendChild(dataURLParams);
  228.             dataElement.appendChild(dataURLElement);
  229.  
  230.             var dataWxIconsElement = xmlDoc.createElement("wxicons");
  231.             dataWxIconsElement.setAttribute("base", nextDataObj.getWxIcons().getBase());
  232.             dataWxIconsElement.setAttribute("small", nextDataObj.getWxIcons().getSmall());
  233.             dataWxIconsElement.setAttribute("large", nextDataObj.getWxIcons().getLarge());
  234.             dataElement.appendChild(dataWxIconsElement);
  235.  
  236.             var dataMoonIconsElement = xmlDoc.createElement("moonphaseicons");
  237.             dataMoonIconsElement.setAttribute("base", nextDataObj.getMoonPhaseIcons().getBase());
  238.             dataElement.appendChild(dataMoonIconsElement);
  239.  
  240.             allData.appendChild(dataElement);
  241.          }
  242.         rootElement.appendChild(allData);
  243.  
  244.         var allMaps = xmlDoc.createElement("maps");
  245.         for(var nextMapKey in this.allMaps) {
  246.             var nextMapObj = this.allMaps[nextMapKey];
  247.             var nextMapElement = xmlDoc.createElement("map");
  248.             nextMapElement.setAttribute("id", nextMapObj.getID());
  249.             var nextMapUSElement = xmlDoc.createElement("isusonly");
  250.             nextMapUSElement.appendChild(xmlDoc.createTextNode(nextMapObj.isUSOnly()));
  251.             nextMapElement.appendChild(nextMapUSElement);
  252.  
  253.             var nextMapTitlelement = xmlDoc.createElement("title");
  254.             nextMapTitlelement.appendChild(xmlDoc.createTextNode(nextMapObj.getTitle()));
  255.             nextMapElement.appendChild(nextMapTitlelement);
  256.  
  257.             var nextMapImageElement = xmlDoc.createElement("image");
  258.             nextMapImageElement.appendChild(xmlDoc.createTextNode(nextMapObj.getImage()));
  259.             nextMapElement.appendChild(nextMapImageElement);
  260.  
  261.             var nextMapImageAltElement = xmlDoc.createElement("imagealt");
  262.             nextMapImageAltElement.appendChild(xmlDoc.createTextNode(nextMapObj.getImageAlt()));
  263.             nextMapElement.appendChild(nextMapImageAltElement);
  264.  
  265.             var nextMapImageWidthElement = xmlDoc.createElement("imagewidth");
  266.             nextMapImageWidthElement.appendChild(xmlDoc.createTextNode(nextMapObj.getImageWidth()));
  267.             nextMapElement.appendChild(nextMapImageWidthElement);
  268.  
  269.             var nextMapImageHeightElement = xmlDoc.createElement("imageheight");
  270.             nextMapImageHeightElement.appendChild(xmlDoc.createTextNode(nextMapObj.getImageHeight()));
  271.             nextMapElement.appendChild(nextMapImageHeightElement);
  272.  
  273.             var nextMapURLtElement = xmlDoc.createElement("url");
  274.             nextMapURLtElement.appendChild(xmlDoc.createCDATASection(nextMapObj.getURL()));
  275.             nextMapElement.appendChild(nextMapURLtElement);
  276.  
  277.             allMaps.appendChild(nextMapElement);
  278.         }
  279.         rootElement.appendChild(allMaps);
  280.  
  281.         var allVideos = xmlDoc.createElement("videos");
  282.         for(var nextVideoKey in this.allVideos) {
  283.             var nextVideoObj = this.allVideos[nextVideoKey];
  284.             var nextVideoElement = xmlDoc.createElement("video");
  285.             nextVideoElement.setAttribute("id", nextVideoObj.getID());
  286.             nextVideoElement.setAttribute("collection", nextVideoObj.getCollection());
  287.  
  288.             var nextVideoName = xmlDoc.createElement("name");
  289.             nextVideoName.appendChild(xmlDoc.createTextNode(nextVideoObj.getName()));
  290.             nextVideoElement.appendChild(nextVideoName);
  291.  
  292.             var nextVideoImage = xmlDoc.createElement("image");
  293.             nextVideoImage.appendChild(xmlDoc.createTextNode(nextVideoObj.getImage()));
  294.             nextVideoElement.appendChild(nextVideoImage);
  295.  
  296.             var nextVideoImageAlt = xmlDoc.createElement("imagealt");
  297.             nextVideoImageAlt.appendChild(xmlDoc.createTextNode(nextVideoObj.getImageAlt()));
  298.             nextVideoElement.appendChild(nextVideoImageAlt);
  299.  
  300.             var nextVideoWidth = xmlDoc.createElement("imagewidth");
  301.             nextVideoWidth.appendChild(xmlDoc.createTextNode(nextVideoObj.getImageWidth()));
  302.             nextVideoElement.appendChild(nextVideoWidth);
  303.  
  304.             var nextVideoHeight = xmlDoc.createElement("imageheight");
  305.             nextVideoHeight.appendChild(xmlDoc.createTextNode(nextVideoObj.getImageHeight()));
  306.             nextVideoElement.appendChild(nextVideoHeight);
  307.  
  308.             var nextVideoTitle = xmlDoc.createElement("title");
  309.             nextVideoTitle.appendChild(xmlDoc.createTextNode(nextVideoObj.getTitle()));
  310.             nextVideoElement.appendChild(nextVideoTitle);
  311.  
  312.             var nextVideoURL = xmlDoc.createElement("url");
  313.             nextVideoURL.appendChild(xmlDoc.createCDATASection(nextVideoObj.getURL()));
  314.             nextVideoElement.appendChild(nextVideoURL);
  315.  
  316.             allVideos.appendChild(nextVideoElement);
  317.         }
  318.         rootElement.appendChild(allVideos);
  319.  
  320.         var allIcons = xmlDoc.createElement("icons");
  321.         for(var nextIconKey in this.allIcons) {
  322.             var nextIconObj = this.allIcons[nextIconKey];
  323.             var nextIconElement = xmlDoc.createElement("icon");
  324.             nextIconElement.setAttribute("id", nextIconObj.getID());
  325.  
  326.             var nextIconUrl = xmlDoc.createElement("url");
  327.             nextIconUrl.appendChild(xmlDoc.createCDATASection(nextIconObj.getURL()));
  328.             nextIconElement.appendChild(nextIconUrl);
  329.  
  330.             var nextIconName = xmlDoc.createElement("name");
  331.             nextIconName.appendChild(xmlDoc.createTextNode(nextIconObj.getName()));
  332.             nextIconElement.appendChild(nextIconName);
  333.  
  334.             var nextIconAlt = xmlDoc.createElement("alt");
  335.             nextIconAlt.appendChild(xmlDoc.createTextNode(nextIconObj.getAlt()));
  336.             nextIconElement.appendChild(nextIconAlt);
  337.  
  338.             var nextIconWidth = xmlDoc.createElement("width");
  339.             nextIconWidth.appendChild(xmlDoc.createTextNode(nextIconObj.getWidth()));
  340.             nextIconElement.appendChild(nextIconWidth);
  341.  
  342.             var nextIconHeight = xmlDoc.createElement("height");
  343.             nextIconHeight.appendChild(xmlDoc.createTextNode(nextIconObj.getHeight()));
  344.             nextIconElement.appendChild(nextIconHeight);
  345.  
  346.             var nextIconExt = xmlDoc.createElement("ext");
  347.             nextIconExt.appendChild(xmlDoc.createTextNode(nextIconObj.getExt()));
  348.             nextIconElement.appendChild(nextIconExt);
  349.  
  350.             allIcons.appendChild(nextIconElement);
  351.         }
  352.         rootElement.appendChild(allIcons);
  353.  
  354.         var allLinks = xmlDoc.createElement("links");
  355.         for(var nextLinksKey in this.allLinks) {
  356.             var nextLinkObj = this.allLinks[nextLinksKey];
  357.             var nextLinkElement = xmlDoc.createElement("link");
  358.             nextLinkElement.setAttribute("id", nextLinkObj.getID());
  359.  
  360.             var nextLinkText = xmlDoc.createElement("text");
  361.             nextLinkText.appendChild(xmlDoc.createCDATASection(nextLinkObj.getText()));
  362.             nextLinkElement.appendChild(nextLinkText);
  363.  
  364.             var nextLinkUrl = xmlDoc.createElement("url");
  365.             nextLinkUrl.appendChild(xmlDoc.createCDATASection(nextLinkObj.getURL()));
  366.             nextLinkElement.appendChild(nextLinkUrl);
  367.  
  368.             var nextLinkAlt = xmlDoc.createElement("alt");
  369.             nextLinkAlt.appendChild(xmlDoc.createTextNode(nextLinkObj.getAlt()));
  370.             nextLinkElement.appendChild(nextLinkAlt);
  371.  
  372.             var nextLinkIcon = xmlDoc.createElement("icon");
  373.             nextLinkIcon.appendChild(xmlDoc.createTextNode(nextLinkObj.getIcon()));
  374.             nextLinkElement.appendChild(nextLinkIcon);
  375.  
  376.             allLinks.appendChild(nextLinkElement);
  377.         }
  378.         rootElement.appendChild(allLinks);
  379.  
  380.        // add the root element!
  381.         xmlDoc.appendChild(rootElement);
  382.  
  383.         return xmlDoc;
  384.     },
  385.  
  386.     // THIS METHOD TRANSFORMS THIS OBJECT
  387.     // TO XML STRING
  388.     toXMLString : function() {
  389.         var myDOM = this.toDOM();
  390.         return myDOM.xml;
  391.     },
  392.  
  393.     getInfo : function() {
  394.         return this.info;
  395.     },
  396.  
  397.     setInfo : function(myInfo) {
  398.         this.info = myInfo;
  399.     },
  400.  
  401.     getAllData : function() {
  402.         return this.allData;
  403.     },
  404.  
  405.     setAllData : function(myAllData) {
  406.         this.allData = myAllData;
  407.     },
  408.  
  409.     addData : function(myData) {
  410.         this.allData[myData.getName()] = myData;
  411.     },
  412.  
  413.     getDataByName : function(myDataName) {
  414.         return this.allData[myDataName];
  415.     },
  416.  
  417.     getAllWindows : function() {
  418.         return this.allWindows;
  419.     },
  420.  
  421.     setAllWindows : function(myAllWindows) {
  422.         this.allWindows = myAllWindows;
  423.     },
  424.  
  425.     addWindow : function(myWindow) {
  426.         this.allWindows[myWindow.getName()] = myWindow;
  427.     },
  428.  
  429.     getWindowByName : function(myWindowName) {
  430.         return this.allWindows[myWindowName];
  431.     },
  432.  
  433.     getAllMaps : function() {
  434.         return this.allMaps;
  435.     },
  436.  
  437.     setAllMaps : function(myAllMaps) {
  438.         this.allMaps = myAllMaps;
  439.     },
  440.  
  441.     addMap : function(myMap) {
  442.         this.allMaps[myMap.getID()] = myMap;
  443.     },
  444.  
  445.     getMapByID : function(myMapID) {
  446.         return this.allMaps[myMapID];
  447.     },
  448.  
  449.     getAllVideos : function() {
  450.         return this.allVideos;
  451.     },
  452.  
  453.     setAllVideos : function(myAllVideos) {
  454.         this.allVideos = myAllVideos;
  455.     },
  456.  
  457.     addVideo : function(myVideo) {
  458.         this.allVideos[myVideo.getID()] = myVideo;
  459.     },
  460.  
  461.     getVideoByID : function(myVideoID) {
  462.         return this.allVideos[myVideoID];
  463.     },
  464.  
  465.     getAllIcons : function() {
  466.         return this.allIcons;
  467.     },
  468.  
  469.     setAllIcons : function(myAllIcons) {
  470.         this.allIcons = myAllIcons;
  471.     },
  472.  
  473.     addIcon : function(myIcon) {
  474.         this.allIcons[myIcon.getID()] = myIcon;
  475.     },
  476.  
  477.     getIconByID : function(myIconID) {
  478.        return this.allIcons[myIconID];
  479.     },
  480.  
  481.     getAllLinks : function() {
  482.         return this.allLinks;
  483.     },
  484.  
  485.     setAllLinks : function(myAllLinks) {
  486.         this.allLinks = myAllLinks;
  487.     },
  488.  
  489.     addLink : function(myLink) {
  490.         this.allLinks[myLink.getID()] = myLink;
  491.     },
  492.  
  493.     getLinkByID : function(myLinkID) {
  494.         return this.allLinks[myLinkID];
  495.     }
  496. };
  497.  
  498. /*************************************
  499.     AppConfigInfo - Includes info
  500.     on this appconfig object
  501. *************************************/
  502. function AppConfigInfo() {
  503. }
  504.  
  505. AppConfigInfo.prototype = {
  506.     version : null,
  507.     lastupdate : null,
  508.     initial : null,
  509.  
  510.     setVersion : function(myVersion) {
  511.         this.version = myVersion;
  512.     },
  513.  
  514.     getVersion : function() {
  515.         return this.version;
  516.     },
  517.  
  518.     setLastUpdate : function(myLastUpdate) {
  519.         this.lastupdate = myLastUpdate;
  520.     },
  521.  
  522.     getLastUpdate : function() {
  523.         return this.lastupdate;
  524.     },
  525.  
  526.     setIsInitial : function(myIsInitial) {
  527.         this.initial = myIsInitial;
  528.     },
  529.  
  530.     getIsInitial : function() {
  531.         return this.initial;
  532.     }    
  533. };
  534.  
  535. /***************************************
  536.     AppWindow describes application
  537.     window information
  538. ****************************************/
  539. function AppWindow() {
  540. }
  541.  
  542. AppWindow.prototype = {
  543.     name : null,
  544.     title : null,
  545.     width : null,
  546.     height : null,
  547.  
  548.     getName : function() {
  549.         return this.name;
  550.     },
  551.  
  552.     setName : function(myName) {
  553.         this.name = myName;
  554.     },
  555.  
  556.     getTitle : function() {
  557.         return this.title;
  558.     },
  559.  
  560.     setTitle : function(myTitle) {
  561.         this.title = myTitle;
  562.     },
  563.  
  564.     getWidth : function() {
  565.         return this.width;
  566.     },
  567.  
  568.     setWidth : function(myWidth) {
  569.         this.width = myWidth;
  570.     },
  571.  
  572.     getHeight : function() {
  573.         return this.height;
  574.     },
  575.  
  576.     setHeight : function(myHeight) {
  577.         this.height = myHeight;
  578.     }
  579. };
  580.  
  581. /***********************************
  582.     AppData - describes app
  583.     data information
  584. ***********************************/
  585. function AppData() {
  586.     this.updateinterval = new AppDataUpdateInterval();
  587.     this.dataurl = new AppDataURL();
  588.     this.wxicons = new AppDataWxIcons();
  589.     this.moonphaseicons = new AppDataMoonphaseIcons();
  590. }
  591.  
  592. AppData.prototype = {
  593.     name : null,
  594.     updateinterval : null,
  595.     dataurl : null,
  596.     wxicons : null,
  597.     moonphaseicons : null,
  598.  
  599.     getName : function() {
  600.         return this.name;
  601.     },
  602.  
  603.     setName : function(myName) {
  604.         this.name = myName;
  605.     },
  606.  
  607.     getUpdateInterval : function() {
  608.         return this.updateinterval;
  609.     },
  610.  
  611.     setUpdateInterval : function(myUpdateInterval) {
  612.         this.updateinterval = myUpdateInterval;
  613.     },
  614.  
  615.  
  616.     getDataURL : function() {
  617.         return this.dataurl;
  618.     },
  619.  
  620.     setDataURL : function(myDataURL) {
  621.         this.dataurl = myDataURL;
  622.     },
  623.  
  624.     getWxIcons : function() {
  625.         return this.wxicons;
  626.     },
  627.  
  628.     setWxIcons : function(myWxIcons) {
  629.         this.wxicons = myWxIcons;
  630.     },
  631.  
  632.     getMoonPhaseIcons : function() {
  633.         return this.moonphaseicons;
  634.     },
  635.  
  636.     setMoonPhaseIcons : function(myMoonPhaseIcons) {
  637.         this.moonphaseicons = myMoonPhaseIcons;
  638.     }
  639. };
  640.  
  641. /*******************************************
  642.     AppDataUpdateInterval - describes app
  643.     data update inteval information
  644. *********************************************/
  645. function AppDataUpdateInterval() {
  646. }
  647.  
  648. AppDataUpdateInterval.prototype = {
  649.     time : null,
  650.     measure : null,
  651.  
  652.     getTime : function() {
  653.         return this.time;
  654.     },
  655.  
  656.     setTime : function(myTime) {
  657.         this.time = myTime;
  658.     },
  659.  
  660.     getMeasure : function() {
  661.         return this.measure;
  662.     },
  663.  
  664.     setMeasure : function(myMeasure) {
  665.         this.measure = myMeasure;
  666.     }
  667. };
  668.  
  669. /*******************************************
  670.     AppDataURL - describes app
  671.     data url information
  672. *********************************************/
  673. function AppDataURL() {
  674.     this.params = {};
  675. }
  676.  
  677. AppDataURL.prototype = {
  678.     base : null,
  679.     params : null,
  680.  
  681.     getBase : function() {
  682.         return this.base;
  683.     },
  684.  
  685.     setBase : function(myBase) {
  686.         this.base = myBase;
  687.     },
  688.  
  689.     getParams : function() {
  690.         return this.params;
  691.     },
  692.  
  693.     setParams : function(myParams) {
  694.         this.params = myParams;
  695.     },
  696.  
  697.     getParamsByName : function(myParamName) {
  698.         return this.params[myParamName];
  699.     },
  700.  
  701.     addNewParam : function(myNewParam) {
  702.         this.params[myNewParam.getName()] = myNewParam;
  703.     }
  704. };
  705.  
  706. /*******************************************
  707.     AppDataURLParam - describes app
  708.     data url parameter information
  709. *********************************************/
  710. function AppDataURLParam() {
  711. }
  712.  
  713. AppDataURLParam.prototype = {
  714.     name : null,
  715.  
  716.     getName : function() {
  717.         return this.name;
  718.     },
  719.  
  720.     setName : function(myName) {
  721.         this.name = myName;
  722.     }
  723. };
  724.  
  725. /*******************************************
  726.     AppDataWxIcons - describes app
  727.     data wx icons information
  728. *********************************************/
  729. function AppDataWxIcons() {
  730. }
  731. AppDataWxIcons.prototype = {
  732.     base : null,
  733.     small : null,
  734.     large : null,
  735.  
  736.     getBase : function() {
  737.         return this.base;
  738.     },
  739.  
  740.     setBase : function(myBase) {
  741.         this.base = myBase;
  742.     },
  743.  
  744.     getSmall : function() {
  745.         return this.small;
  746.     },
  747.  
  748.     setSmall : function(mySmall) {
  749.         this.small = mySmall;
  750.     },
  751.  
  752.     getLarge : function() {
  753.         return this.large;
  754.     },
  755.  
  756.     setLarge : function(myLarge) {
  757.         this.large = myLarge;
  758.     }
  759. };
  760.  
  761. /*******************************************
  762.     AppDataMoonphaseIcons - describes app
  763.     data wx moonphase icons information
  764. *********************************************/
  765. function AppDataMoonphaseIcons() {
  766. }
  767. AppDataMoonphaseIcons.prototype = {
  768.     base : null,
  769.     getBase : function() {
  770.         return this.base;
  771.     },
  772.  
  773.     setBase : function(myBase) {
  774.         this.base = myBase;
  775.     }
  776. };
  777.  
  778. /***************************
  779.     AppMap - describes app
  780.     maps information
  781. ***************************/
  782. function AppMap() {
  783. }
  784. AppMap.prototype = {
  785.     id : null,
  786.     isusonly : null,
  787.     title : null,
  788.     image : null,
  789.     imagealt : null,
  790.     imagewidth : null,
  791.     imageheight : null,
  792.     url : null,
  793.  
  794.     getID : function() {
  795.         return this.id;
  796.     },
  797.  
  798.     setID : function(myID) {
  799.         this.id = myID;
  800.     },
  801.  
  802.     isUSOnly : function() {
  803.         return this.isusonly;
  804.     },
  805.  
  806.     setIsUSOnly : function(myIsUSOnly) {
  807.         this.isusonly = myIsUSOnly;
  808.     },
  809.  
  810.     getTitle : function() {
  811.         return this.title;
  812.     },
  813.  
  814.     setTitle : function(myTitle) {
  815.         this.title = myTitle;
  816.     },
  817.  
  818.     getImage : function() {
  819.         return this.image;
  820.     },
  821.  
  822.     setImage : function(myImage){
  823.         this.image = myImage;
  824.     },
  825.  
  826.     getImageAlt : function() {
  827.         return this.imagealt;
  828.     },
  829.  
  830.     setImageAlt : function(myImageAlt){
  831.         this.imagealt = myImageAlt;
  832.     },
  833.  
  834.     getImageWidth : function() {
  835.         return this.imagewidth;
  836.     },
  837.  
  838.     setImageWidth : function(myImageWidth){
  839.         this.imagewidth = myImageWidth;
  840.     },
  841.  
  842.     getImageHeight : function() {
  843.         return this.imageheight;
  844.     },
  845.  
  846.     setImageHeight : function(myImageHeight){
  847.         this.imageheight = myImageHeight;
  848.     },
  849.  
  850.     getURL : function() {
  851.         return this.url;
  852.     },
  853.  
  854.     setURL : function(myURL) {
  855.         this.url = myURL;
  856.     }
  857. };
  858.  
  859. /***************************
  860.     AppVideo - describes app
  861.     videos information
  862. ***************************/
  863. function AppVideo() {
  864. }
  865.  
  866. AppVideo.prototype = {
  867.     id : null,
  868.     collection : null,
  869.     name : null,
  870.     image : null,
  871.     imagealt : null,
  872.     imagewidth : null,
  873.     imageheigt : null,
  874.     title : null,
  875.     url : null,
  876.  
  877.     getURL : function() {
  878.         return this.url;
  879.     },
  880.  
  881.     setURL : function(myURL) {
  882.         this.url = myURL;
  883.     },
  884.  
  885.     getID : function() {
  886.         return this.id;
  887.     },
  888.  
  889.     setID : function(myID) {
  890.         this.id = myID;
  891.     },
  892.  
  893.     getCollection : function() {
  894.         return this.collection;
  895.     },
  896.  
  897.     setCollection : function(myCollection) {
  898.         this.collection = myCollection;
  899.     },
  900.  
  901.     getTitle : function() {
  902.         return this.title;
  903.     },
  904.  
  905.     setTitle : function(myTitle) {
  906.         this.title = myTitle;
  907.     },
  908.  
  909.     getImage : function() {
  910.         return this.image;
  911.     },
  912.  
  913.     setImage : function(myImage){
  914.         this.image = myImage;
  915.     },
  916.  
  917.     getImageAlt : function() {
  918.         return this.imagealt;
  919.     },
  920.  
  921.     setImageAlt : function(myImageAlt){
  922.         this.imagealt = myImageAlt;
  923.     },
  924.  
  925.     getImageWidth : function() {
  926.         return this.imagewidth;
  927.     },
  928.  
  929.     setImageWidth : function(myImageWidth){
  930.         this.imagewidth = myImageWidth;
  931.     },
  932.  
  933.     getImageHeight : function() {
  934.         return this.imageheight;
  935.     },
  936.  
  937.     setImageHeight : function(myImageHeight){
  938.         this.imageheight = myImageHeight;
  939.     },
  940.  
  941.     getName : function() {
  942.         return this.name;
  943.     },
  944.  
  945.     setName : function(myName) {
  946.         this.name = myName;
  947.     }
  948. };
  949.  
  950. /***************************
  951.     AppIcon - describes app
  952.     icons information
  953. ***************************/
  954. function AppIcon() {
  955. }
  956.  
  957. AppIcon.prototype = {
  958.     id : null,
  959.     url : null,
  960.     name : null,
  961.     alt : null,
  962.     width : null,
  963.     height : null,
  964.     ext : null,
  965.  
  966.     getID : function() {
  967.         return this.id;
  968.     },
  969.  
  970.     setID : function(myID) {
  971.         this.id = myID;
  972.     },
  973.  
  974.     getURL : function() {
  975.         return this.url;
  976.     },
  977.  
  978.     setURL : function(myURL) {
  979.         this.url = myURL;
  980.     },
  981.  
  982.     getName : function() {
  983.         return this.name;
  984.     },
  985.  
  986.     setName : function(myName) {
  987.         this.name = myName;
  988.     },
  989.  
  990.     getAlt : function() {
  991.         return this.alt;
  992.     },
  993.  
  994.     setAlt : function(myAlt) {
  995.         this.alt = myAlt;
  996.     },
  997.  
  998.     getWidth : function() {
  999.         return this.width;
  1000.     },
  1001.  
  1002.     setWidth : function(myWidth) {
  1003.         this.width = myWidth;
  1004.     },
  1005.  
  1006.     getHeight : function() {
  1007.         return this.height;
  1008.     },
  1009.  
  1010.     setHeight : function(myHeight) {
  1011.         this.height = myHeight;
  1012.     },
  1013.  
  1014.     getExt : function() {
  1015.         return this.ext;
  1016.     },
  1017.  
  1018.     setExt : function(myExt) {
  1019.         this.ext = myExt;
  1020.     }
  1021. };
  1022.  
  1023.  /***************************
  1024.     AppLink - describes app
  1025.     links information
  1026. ***************************/
  1027. function AppLink() {
  1028. }
  1029.  
  1030. AppLink.prototype = {
  1031.     id : null,
  1032.     text : null,
  1033.     url : null,
  1034.     alt : null,
  1035.     icon : null,
  1036.  
  1037.     getID : function() {
  1038.         return this.id;
  1039.     },
  1040.  
  1041.     setID : function(myID) {
  1042.         this.id = myID;
  1043.     },
  1044.  
  1045.     getText : function() {
  1046.         return this.text;
  1047.     },
  1048.  
  1049.     setText : function(myText) {
  1050.         this.text = myText;
  1051.     },
  1052.  
  1053.     getURL : function() {
  1054.         return this.url;
  1055.     },
  1056.  
  1057.     setURL : function(myURL) {
  1058.         this.url = myURL;
  1059.     },
  1060.  
  1061.     getAlt : function() {
  1062.         return this.alt;
  1063.     },
  1064.  
  1065.     setAlt : function(myAlt) {
  1066.         this.alt = myAlt;
  1067.     },
  1068.  
  1069.     getIcon : function() {
  1070.        return this.icon;
  1071.     },
  1072.  
  1073.     setIcon : function(myIcon) {
  1074.         this.icon = myIcon;
  1075.     }
  1076. };
  1077.